<div class="comments">
    {% for comment in comments %}
        <div class="comment panel panel-default">
            <div class="panel-heading">
                <span class="comment-thumbail img-circle">
                    <a href="{{ url_for('main.user',username=comment.author.username)}}">
                        <img class="img-rounded profile-thumbail"
                        src="{{ comment.author.gravatar(16) }}">
                    </a>
                </span>
                <span class="comment-author">
                    <a href="{{ url_for('main.user',username=comment.author.username) }}">
                        {{ comment.author.username }}
                    </a>
                </span>
                <span class="pull-right">
                    <span class="comment-date label label-default">{{ moment(comment.timestamp).fromNow() }}</span>
                    <span class="label label-default">评论</span>
                    
                </span>
                
            </div>

            <div class="panel-body">
                <div class="comment-body">
                    {% if comment.disabled %}                    <!--评论被禁止了-->
                        <p><i>该条评论已经被协管员禁止了</i></p>
                    {% endif %}
                    {% if moderate or not comment.disabled %}
                        {% if comment.body_html %}
                            {{ comment.body_html|safe }}
                        {% else %}
                            {{ comment.body }}
                        {% endif %}
                    {% endif %}
                </div>
                {% if moderate %}       <!--moderate设为True,而普通用户发表评论是没有moderate这个变量的-->
                    <br>
                    {% if comment.disabled %}
                        <a class="btn btn-default btn-xs"
                           href="{{ url_for('main.moderate_enable',id=comment.id,page=page) }}">
                            Enable
                        </a>
                    {% else %}
                        <a class="btn btn-danger btn-xs"
                            href="{{ url_for('main.moderate_disable',id=comment.id,page=page) }}">
                            Disable
                        </a>    <!--btn-xs按键好像变小了-->
                    {% endif %}
                {% endif %}
            </div>
        </div>
    {% endfor %}
</div>